/* --------------------------------------------------------
 * Copyright (c) aeky , Inc.  All rights reserved.
 * --------------------------------------------------------
 */
package com.aeky.client.view.welcome;

import com.aeky.client.common.AppParams;
import com.aeky.client.common.DemoConstants;
import com.aeky.client.common.DemoEvents;
import com.aeky.client.common.Registry;
import com.aeky.client.mvc.AppEvent;
import com.aeky.client.mvc.Controller;
import com.aeky.client.mvc.View;
import com.smartgwt.client.widgets.Label;
import com.smartgwt.client.widgets.layout.HLayout;

/**
 * TODO
 * 
 * @author aeky
 */
public class CenterHeadPanelView extends View {

    private HLayout centerHeadPanel;

    public CenterHeadPanelView(Controller controller) {
        super(controller);
        centerHeadPanel = Registry.get(DemoConstants.CENTER_HEAD_PANEL);
    }

    private void initEvents() {
        Label label = new Label("欢迎：" + AppParams.getInstance().getUser().getRealName());
        label.setWidth(200);
        label.setStyleName("labelStyle");
        centerHeadPanel.addMember(label);
    }

    /*
     * 
     * @see com.aeky.client.mvc.View#handleEvent(com.aeky.client.mvc.AppEvent)
     */
    @Override
    protected void handleEvent(AppEvent event) {
        if (event.getType() == DemoEvents.INIT) {
            this.initEvents();
        }
    }

}
